<template>
  <the-table
    ref="table"
    :columns="columns"
    uri="seller-accounts"
    :slots="['income']"
    @loaded="loaded"
  >
    <span slot="income" slot-scope="{ row }">{{
      row.done_tasks_sum_fee * 1 + row.done_tasks_sum_tip * 1
    }}</span>
  </the-table>
</template>
<script>
import theTable from '@/components/theTable.vue'
import moment from 'moment'
import tableFooter from '@/mixins/table-footer.js'

const columns = [
  {
    title: 'ID',
    dataIndex: 'id',
  },
  {
    title: '商户名',
    dataIndex: 'user.username',
    searchAble: true,
  },
  {
    title: '时间段',
    dataIndex: 'created_at',
    dataType: 'range',
    visible: false,
    searchAble: true,
    search: {
      value: [moment(), moment()],
    },
  },
  {
    title: '买币',
    dataIndex: 'boughts_sum_coins',
  },
  {
    title: '卖币',
    dataIndex: 'sells_sum_coins',
  },
  {
    title: '手续费',
    dataIndex: 'boughts_sum_fee',
  },
  {
    title: '支出奖励',
    dataIndex: 'solds_sum_tip',
  },
  {
    title: '已处理金额',
    dataIndex: 'solds_sum_coins',
  },
  {
    title: '已处理笔数',
    dataIndex: 'solds_count',
  },
  {
    title: '未处理金额',
    dataIndex: 'waiting_sells_sum_coins',
  },
  {
    title: '未处理笔数',
    dataIndex: 'waiting_sells_count',
  },
  {
    title: '已取消金额',
    dataIndex: 'canceled_sum_coins',
  },
  {
    title: '已取消笔数',
    dataIndex: 'canceled_count',
  },
]

export default {
  components: { theTable },
  mixins: [tableFooter],

  data() {
    return {
      columns,
    }
  },
  mounted() {},
  methods: {},
}
</script>
